﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using billtracker.Models;

namespace billtracker.Controllers
{
    public class jsonBillsController : Controller
    {
        private billDBContext db = new billDBContext();
        //
        // GET: /jsonBills/
        public JsonResult getBill(int id)
        {
            bill bill = db.Bill.Find(id);
            jsonBill jBill = new jsonBill(bill);
            return Json(jBill, JsonRequestBehavior.AllowGet);
        }
        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}
